package com.pomelo.config;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.bstek.ureport.Utils;
import com.bstek.ureport.build.HideRowColumnBuilder;
import com.bstek.ureport.build.ReportBuilder;
import com.bstek.ureport.cache.CacheUtils;
import com.bstek.ureport.console.UReportServlet;
import com.bstek.ureport.console.cache.HttpSessionReportCache;
import com.bstek.ureport.console.chart.ChartServletAction;
import com.bstek.ureport.console.designer.DatasourceServletAction;
import com.bstek.ureport.console.designer.DesignerServletAction;
import com.bstek.ureport.console.designer.SearchFormDesignerAction;
import com.bstek.ureport.console.excel.ExportExcel97ServletAction;
import com.bstek.ureport.console.excel.ExportExcelServletAction;
import com.bstek.ureport.console.html.HtmlPreviewServletAction;
import com.bstek.ureport.console.image.ImageServletAction;
import com.bstek.ureport.console.importexcel.ImportExcelServletAction;
import com.bstek.ureport.console.pdf.ExportPdfServletAction;
import com.bstek.ureport.console.res.ResourceLoaderServletAction;
import com.bstek.ureport.console.word.ExportWordServletAction;
import com.bstek.ureport.export.ExportManager;
import com.bstek.ureport.export.ExportManagerImpl;
import com.bstek.ureport.export.ReportRender;
import com.bstek.ureport.export.pdf.font.FontBuilder;
import com.bstek.ureport.expression.ExpressionUtils;
import com.bstek.ureport.expression.function.AvgFunction;
import com.bstek.ureport.expression.function.ColumnFunction;
import com.bstek.ureport.expression.function.CountFunction;
import com.bstek.ureport.expression.function.FormatDateFunction;
import com.bstek.ureport.expression.function.FormatNumberFunction;
import com.bstek.ureport.expression.function.GetFunction;
import com.bstek.ureport.expression.function.JsonFunction;
import com.bstek.ureport.expression.function.ListFunction;
import com.bstek.ureport.expression.function.MaxFunction;
import com.bstek.ureport.expression.function.MinFunction;
import com.bstek.ureport.expression.function.OrderFunction;
import com.bstek.ureport.expression.function.ParameterFunction;
import com.bstek.ureport.expression.function.ParameterIsEmptyFunction;
import com.bstek.ureport.expression.function.RowFunction;
import com.bstek.ureport.expression.function.SumFunction;
import com.bstek.ureport.expression.function.date.DateFunction;
import com.bstek.ureport.expression.function.date.DayFunction;
import com.bstek.ureport.expression.function.date.MonthFunction;
import com.bstek.ureport.expression.function.date.WeekFunction;
import com.bstek.ureport.expression.function.date.YearFunction;
import com.bstek.ureport.expression.function.math.AbsFunction;
import com.bstek.ureport.expression.function.math.CeilFunction;
import com.bstek.ureport.expression.function.math.ChnFunction;
import com.bstek.ureport.expression.function.math.ChnMoneyFunction;
import com.bstek.ureport.expression.function.math.CosFunction;
import com.bstek.ureport.expression.function.math.ExpFunction;
import com.bstek.ureport.expression.function.math.FloorFunction;
import com.bstek.ureport.expression.function.math.Log10Function;
import com.bstek.ureport.expression.function.math.LogFunction;
import com.bstek.ureport.expression.function.math.MedianFunction;
import com.bstek.ureport.expression.function.math.ModeFunction;
import com.bstek.ureport.expression.function.math.PowFunction;
import com.bstek.ureport.expression.function.math.RandomFunction;
import com.bstek.ureport.expression.function.math.RoundFunction;
import com.bstek.ureport.expression.function.math.SinFunction;
import com.bstek.ureport.expression.function.math.SqrtFunction;
import com.bstek.ureport.expression.function.math.StdevpFunction;
import com.bstek.ureport.expression.function.math.TanFunction;
import com.bstek.ureport.expression.function.math.VaraFunction;
import com.bstek.ureport.expression.function.page.PageAvgFunction;
import com.bstek.ureport.expression.function.page.PageCountFunction;
import com.bstek.ureport.expression.function.page.PageMaxFunction;
import com.bstek.ureport.expression.function.page.PageMinFunction;
import com.bstek.ureport.expression.function.page.PageNumberFunction;
import com.bstek.ureport.expression.function.page.PageRowsFunction;
import com.bstek.ureport.expression.function.page.PageSumFunction;
import com.bstek.ureport.expression.function.page.PageTotalFunction;
import com.bstek.ureport.expression.function.string.IndexOfFunction;
import com.bstek.ureport.expression.function.string.LengthFunction;
import com.bstek.ureport.expression.function.string.LowerFunction;
import com.bstek.ureport.expression.function.string.ReplaceFunction;
import com.bstek.ureport.expression.function.string.SubstringFunction;
import com.bstek.ureport.expression.function.string.TrimFunction;
import com.bstek.ureport.expression.function.string.UpperFunction;
import com.bstek.ureport.font.arial.ArialFontRegister;
import com.bstek.ureport.font.comicsansms.ComicSansMSFontRegister;
import com.bstek.ureport.font.couriernew.CourierNewFontRegister;
import com.bstek.ureport.font.fangsong.FangSongFontRegister;
import com.bstek.ureport.font.heiti.HeiTiFontRegister;
import com.bstek.ureport.font.kaiti.KaiTiFontRegister;
import com.bstek.ureport.font.songti.SongTiFontRegister;
import com.bstek.ureport.font.timesnewroman.TimesNewRomanFontRegister;
import com.bstek.ureport.font.yahei.YaheiFontRegister;
import com.bstek.ureport.parser.ReportParser;
import com.bstek.ureport.parser.impl.searchform.CheckboxParser;
import com.bstek.ureport.parser.impl.searchform.DatetimeInputParser;
import com.bstek.ureport.parser.impl.searchform.FormParserUtils;
import com.bstek.ureport.parser.impl.searchform.GridParser;
import com.bstek.ureport.parser.impl.searchform.RadioInputParser;
import com.bstek.ureport.parser.impl.searchform.ResetButtonParser;
import com.bstek.ureport.parser.impl.searchform.SelectInputParser;
import com.bstek.ureport.parser.impl.searchform.SubmitButtonParser;
import com.bstek.ureport.parser.impl.searchform.TextInputParser;
import com.bstek.ureport.provider.image.DefaultImageProvider;
import com.bstek.ureport.provider.image.HttpImageProvider;
import com.bstek.ureport.provider.image.HttpsImageProvider;
import com.bstek.ureport.provider.report.classpath.ClasspathReportProvider;
import com.bstek.ureport.provider.report.file.FileReportProvider;

@Configuration
public class ReportConfiguration {

    @Value("${ureport.disableHttpSessionReportCache:false}")
    private boolean disableHttpSessionReportCache;

    @Value("${ureport.disableFileProvider:false}")
    private boolean disableFileProvider;

    @Value("${ureport.fileStoreDir}")
    private String fileStoreDir;

    @Value("${ureport.debug:true}")
    private boolean debug;

    @Bean
    public ServletRegistrationBean<UReportServlet> uReportServlet() {
        List<String> urls = new ArrayList<String>();
        urls.add("/ureport/*");
        ServletRegistrationBean<UReportServlet> servletRegistrationBean =
            new ServletRegistrationBean<UReportServlet>(new UReportServlet(), urls.toArray(new String[] {}));
        return servletRegistrationBean;
    }

    @Bean("ureport.exportManager")
    public ExportManagerImpl exportManagerImpl(ReportRender reportRender) {
        ExportManagerImpl exportManagerImpl = new ExportManagerImpl();
        exportManagerImpl.setReportRender(reportRender);
        return exportManagerImpl;
    }

    @Bean("ureport.reportRender")
    public ReportRender reportRender(ReportParser reportParser, ReportBuilder reportBuilder) {
        ReportRender reportRender = new ReportRender();
        reportRender.setReportBuilder(reportBuilder);
        reportRender.setReportParser(reportParser);
        return reportRender;
    }

    @Bean("ureport.defaultImageProvider")
    public DefaultImageProvider defaultImageProvider() {
        DefaultImageProvider defaultImageProvider = new DefaultImageProvider();
        return defaultImageProvider;
    }

    @Bean("ureport.fileReportProvider")
    public FileReportProvider fileReportProvider() {
        FileReportProvider fileReportProvider = new FileReportProvider();
        fileReportProvider.setFileStoreDir(fileStoreDir);
        return fileReportProvider;
    }

    @Bean("ureport.httpImageProvider")
    public HttpImageProvider httpImageProvider() {
        HttpImageProvider httpImageProvider = new HttpImageProvider();
        return httpImageProvider;
    }

    @Bean("ureport.httpsImageProvider")
    public HttpsImageProvider httpsImageProvider() {
        HttpsImageProvider httpsImageProvider = new HttpsImageProvider();
        return httpsImageProvider;
    }

    @Bean("ureport.reportBuilder")
    public ReportBuilder reportBuilder(HideRowColumnBuilder hideRowColumnBuilder) {
        ReportBuilder reportBuilder = new ReportBuilder();
        reportBuilder.setHideRowColumnBuilder(hideRowColumnBuilder);
        return reportBuilder;
    }

    @Bean("ureport.hideRowColumnBuilder")
    public HideRowColumnBuilder hideRowColumnBuilder() {
        HideRowColumnBuilder hideRowColumnBuilder = new HideRowColumnBuilder();
        return hideRowColumnBuilder;
    }

    @Bean("ureport.reportParser")
    public ReportParser reportParser() {
        ReportParser reportParser = new ReportParser();
        return reportParser;
    }

    @Bean("ureport.formParserUtils")
    public FormParserUtils formParserUtils() {
        FormParserUtils formParserUtils = new FormParserUtils();
        return formParserUtils;
    }

    @Bean("ureport.checkboxParser")
    public CheckboxParser checkboxParser() {
        CheckboxParser checkboxParser = new CheckboxParser();
        return checkboxParser;
    }

    @Bean("ureport.gridParser")
    public GridParser gridParser() {
        GridParser gridParser = new GridParser();
        return gridParser;
    }

    @Bean("ureport.radioInputParser")
    public RadioInputParser radioInputParser() {
        RadioInputParser radioInputParser = new RadioInputParser();
        return radioInputParser;
    }

    @Bean("ureport.rextInputParser")
    public TextInputParser rextInputParser() {
        TextInputParser rextInputParser = new TextInputParser();
        return rextInputParser;
    }

    @Bean("ureport.resetButtonParser")
    public ResetButtonParser resetButtonParser() {
        ResetButtonParser resetButtonParser = new ResetButtonParser();
        return resetButtonParser;
    }

    @Bean("ureport.submitButtonParser")
    public SubmitButtonParser submitButtonParser() {
        SubmitButtonParser submitButtonParser = new SubmitButtonParser();
        return submitButtonParser;
    }

    @Bean("ureport.selectInputParser")
    public SelectInputParser selectInputParser() {
        SelectInputParser selectInputParser = new SelectInputParser();
        return selectInputParser;
    }

    @Bean("ureport.datetimeInputParser")
    public DatetimeInputParser datetimeInputParser() {
        DatetimeInputParser datetimeInputParser = new DatetimeInputParser();
        return datetimeInputParser;
    }

    @Bean("ureport.classpathReportProvider")
    public ClasspathReportProvider classpathReportProvider() {
        ClasspathReportProvider classpathReportProvider = new ClasspathReportProvider();
        return classpathReportProvider;
    }

    @Bean("ureport.fontBuilder")
    public FontBuilder fontBuilder() {
        FontBuilder fontBuilder = new FontBuilder();
        return fontBuilder;
    }

    @Bean("ureport.expressionUtils")
    public ExpressionUtils expressionUtils() {
        ExpressionUtils expressionUtils = new ExpressionUtils();
        return expressionUtils;
    }

    @Bean("ureport.utils")
    public Utils utils() {
        Utils utils = new Utils();
        utils.setDebug(debug);
        return utils;
    }

    @Bean("ureport.cacheUtils")
    public CacheUtils cacheUtils() {
        CacheUtils cacheUtils = new CacheUtils();
        return cacheUtils;
    }

    @Bean("ureport.countFunction")
    public CountFunction countFunction() {
        CountFunction countFunction = new CountFunction();
        return countFunction;
    }

    @Bean("ureport.sumFunction")
    public SumFunction sumFunction() {
        SumFunction sumFunction = new SumFunction();
        return sumFunction;
    }

    @Bean("ureport.maxFunction")
    public MaxFunction maxFunction() {
        MaxFunction maxFunction = new MaxFunction();
        return maxFunction;
    }

    @Bean("ureport.minFunction")
    public MinFunction minFunction() {
        MinFunction minFunction = new MinFunction();
        return minFunction;
    }

    @Bean("ureport.listFunction")
    public ListFunction listFunction() {
        ListFunction listFunction = new ListFunction();
        return listFunction;
    }

    @Bean("ureport.avgFunction")
    public AvgFunction avgFunction() {
        AvgFunction avgFunction = new AvgFunction();
        return avgFunction;
    }

    @Bean("ureport.orderFunction")
    public OrderFunction orderFunction() {
        OrderFunction orderFunction = new OrderFunction();
        return orderFunction;
    }

    @Bean("ureport.WeekFunction")
    public WeekFunction weekFunction() {
        WeekFunction weekFunction = new WeekFunction();
        return weekFunction;
    }

    @Bean("ureport.dayFunction")
    public DayFunction dayFunction() {
        DayFunction dayFunction = new DayFunction();
        return dayFunction;
    }

    @Bean("ureport.monthFunction")
    public MonthFunction monthFunction() {
        MonthFunction monthFunction = new MonthFunction();
        return monthFunction;
    }

    @Bean("ureport.yearFunction")
    public YearFunction yearFunction() {
        YearFunction yearFunction = new YearFunction();
        return yearFunction;
    }

    @Bean("ureport.dateFunction")
    public DateFunction dateFunction() {
        DateFunction dateFunction = new DateFunction();
        return dateFunction;
    }

    @Bean("ureport.formatNumberFunction")
    public FormatNumberFunction formatNumberFunction() {
        FormatNumberFunction formatNumberFunction = new FormatNumberFunction();
        return formatNumberFunction;
    }

    @Bean("ureport.formatDateFunction")
    public FormatDateFunction formatDateFunction() {
        FormatDateFunction formatDateFunction = new FormatDateFunction();
        return formatDateFunction;
    }

    @Bean("ureport.getFunction")
    public GetFunction getFunction() {
        GetFunction getFunction = new GetFunction();
        return getFunction;
    }

    @Bean("ureport.absFunction")
    public AbsFunction absFunction() {
        AbsFunction absFunction = new AbsFunction();
        return absFunction;
    }

    @Bean("ureport.ceilFunction")
    public CeilFunction ceilFunction() {
        CeilFunction ceilFunction = new CeilFunction();
        return ceilFunction;
    }

    @Bean("ureport.ChnFunction")
    public ChnFunction chnFunction() {
        ChnFunction chnFunction = new ChnFunction();
        return chnFunction;
    }

    @Bean("ureport.ChnMoneyFunction")
    public ChnMoneyFunction chnMoneyFunction() {
        ChnMoneyFunction chnMoneyFunction = new ChnMoneyFunction();
        return chnMoneyFunction;
    }

    @Bean("ureport.CosFunction")
    public CosFunction cosFunction() {
        CosFunction cosFunction = new CosFunction();
        return cosFunction;
    }

    @Bean("ureport.ExpFunction")
    public ExpFunction expFunction() {
        ExpFunction expFunction = new ExpFunction();
        return expFunction;
    }

    @Bean("ureport.floorFunction")
    public FloorFunction floorFunction() {
        FloorFunction floorFunction = new FloorFunction();
        return floorFunction;
    }

    @Bean("ureport.log10Function")
    public Log10Function log10Function() {
        Log10Function log10Function = new Log10Function();
        return log10Function;
    }

    @Bean("ureport.logFunction")
    public LogFunction logFunction() {
        LogFunction logFunction = new LogFunction();
        return logFunction;
    }

    @Bean("ureport.powFunction")
    public PowFunction powFunction() {
        PowFunction powFunction = new PowFunction();
        return powFunction;
    }

    @Bean("ureport.randomFunction")
    public RandomFunction randomFunction() {
        RandomFunction randomFunction = new RandomFunction();
        return randomFunction;
    }

    @Bean("ureport.roundFunction")
    public RoundFunction roundFunction() {
        RoundFunction roundFunction = new RoundFunction();
        return roundFunction;
    }

    @Bean("ureport.sinFunction")
    public SinFunction sinFunction() {
        SinFunction sinFunction = new SinFunction();
        return sinFunction;
    }

    @Bean("ureport.sqrtFunction")
    public SqrtFunction sqrtFunction() {
        SqrtFunction sqrtFunction = new SqrtFunction();
        return sqrtFunction;
    }

    @Bean("ureport.tanFunction")
    public TanFunction tanFunction() {
        TanFunction tanFunction = new TanFunction();
        return tanFunction;
    }

    @Bean("ureport.stdevpFunction")
    public StdevpFunction stdevpFunction() {
        StdevpFunction stdevpFunction = new StdevpFunction();
        return stdevpFunction;
    }

    @Bean("ureport.varaFunction")
    public VaraFunction varaFunction() {
        VaraFunction varaFunction = new VaraFunction();
        return varaFunction;
    }

    @Bean("ureport.modeFunction")
    public ModeFunction modeFunction() {
        ModeFunction modeFunction = new ModeFunction();
        return modeFunction;
    }

    @Bean("ureport.medianFunction")
    public MedianFunction medianFunction() {
        MedianFunction medianFunction = new MedianFunction();
        return medianFunction;
    }

    @Bean("ureport.lengthFunction")
    public LengthFunction lengthFunction() {
        LengthFunction lengthFunction = new LengthFunction();
        return lengthFunction;
    }

    @Bean("ureport.lowerFunction")
    public LowerFunction lowerFunction() {
        LowerFunction lowerFunction = new LowerFunction();
        return lowerFunction;
    }

    @Bean("ureport.IndexOfFunction")
    public IndexOfFunction indexOfFunction() {
        IndexOfFunction indexOfFunction = new IndexOfFunction();
        return indexOfFunction;
    }

    @Bean("ureport.replaceFunction")
    public ReplaceFunction replaceFunction() {
        ReplaceFunction replaceFunction = new ReplaceFunction();
        return replaceFunction;
    }

    @Bean("ureport.substringFunction")
    public SubstringFunction substringFunction() {
        SubstringFunction substringFunction = new SubstringFunction();
        return substringFunction;
    }

    @Bean("ureport.trimFunction")
    public TrimFunction trimFunction() {
        TrimFunction trimFunction = new TrimFunction();
        return trimFunction;
    }

    @Bean("ureport.upperFunction")
    public UpperFunction upperFunction() {
        UpperFunction upperFunction = new UpperFunction();
        return upperFunction;
    }

    @Bean("ureport.pageTotalFunction")
    public PageTotalFunction pageTotalFunction() {
        PageTotalFunction pageTotalFunction = new PageTotalFunction();
        return pageTotalFunction;
    }

    @Bean("ureport.pageNumberFunction")
    public PageNumberFunction pageNumberFunction() {
        PageNumberFunction pageNumberFunction = new PageNumberFunction();
        return pageNumberFunction;
    }

    @Bean("ureport.pageAvgFunction")
    public PageAvgFunction pageAvgFunction() {
        PageAvgFunction pageAvgFunction = new PageAvgFunction();
        return pageAvgFunction;
    }

    @Bean("ureport.pageCountFunction")
    public PageCountFunction pageCountFunction() {
        PageCountFunction pageCountFunction = new PageCountFunction();
        return pageCountFunction;
    }

    @Bean("ureport.pageMaxFunction")
    public PageMaxFunction pageMaxFunction() {
        PageMaxFunction pageMaxFunction = new PageMaxFunction();
        return pageMaxFunction;
    }

    @Bean("ureport.pageMinFunction")
    public PageMinFunction pageMinFunction() {
        PageMinFunction pageMinFunction = new PageMinFunction();
        return pageMinFunction;
    }

    @Bean("ureport.pageRowsFunction")
    public PageRowsFunction pageRowsFunction() {
        PageRowsFunction pageRowsFunction = new PageRowsFunction();
        return pageRowsFunction;
    }

    @Bean("ureport.pageSumFunction")
    public PageSumFunction pageSumFunction() {
        PageSumFunction pageSumFunction = new PageSumFunction();
        return pageSumFunction;
    }

    @Bean("ureport.parameterFunction")
    public ParameterFunction parameterFunction() {
        ParameterFunction parameterFunction = new ParameterFunction();
        return parameterFunction;
    }

    @Bean("ureport.parameterIsEmptyFunction")
    public ParameterIsEmptyFunction parameterIsEmptyFunction() {
        ParameterIsEmptyFunction parameterIsEmptyFunction = new ParameterIsEmptyFunction();
        return parameterIsEmptyFunction;
    }

    @Bean("ureport.jsonFunction")
    public JsonFunction jsonFunction() {
        JsonFunction jsonFunction = new JsonFunction();
        return jsonFunction;
    }

    @Bean("ureport.rowFunction")
    public RowFunction rowFunction() {
        RowFunction rowFunction = new RowFunction();
        return rowFunction;
    }

    @Bean("ureport.columnFunction")
    public ColumnFunction columnFunction() {
        ColumnFunction columnFunction = new ColumnFunction();
        return columnFunction;
    }

    /**
     * console
     */
    @Bean("ureport.datasourceServletAction")
    public DatasourceServletAction datasourceServletAction() {
        DatasourceServletAction datasourceServletAction = new DatasourceServletAction();
        return datasourceServletAction;
    }

    @Bean("ureport.resourceLoaderServletAction")
    public ResourceLoaderServletAction resourceLoaderServletAction() {
        ResourceLoaderServletAction resourceLoaderServletAction = new ResourceLoaderServletAction();
        return resourceLoaderServletAction;
    }

    @Bean("ureport.designerServletAction")
    public DesignerServletAction designerServletAction() {
        DesignerServletAction designerServletAction = new DesignerServletAction();
        return designerServletAction;
    }

    @Bean("ureport.designerServletAction")
    public DesignerServletAction designerServletAction(ReportRender reportRender, ReportParser reportParser) {
        DesignerServletAction designerServletAction = new DesignerServletAction();
        designerServletAction.setReportParser(reportParser);
        designerServletAction.setReportRender(reportRender);
        return designerServletAction;
    }

    @Bean("ureport.searchFormDesignerAction")
    public SearchFormDesignerAction searchFormDesignerAction() {
        SearchFormDesignerAction searchFormDesignerAction = new SearchFormDesignerAction();
        return searchFormDesignerAction;
    }

    @Bean("ureport.htmlPreviewServletAction")
    public HtmlPreviewServletAction htmlPreviewServletAction(ExportManager exportManager, ReportBuilder reportBuilder, ReportRender reportRender) {
        HtmlPreviewServletAction htmlPreviewServletAction = new HtmlPreviewServletAction();
        htmlPreviewServletAction.setExportManager(exportManager);
        htmlPreviewServletAction.setReportBuilder(reportBuilder);
        htmlPreviewServletAction.setReportRender(reportRender);
        return htmlPreviewServletAction;
    }

    @Bean("ureport.exportWordServletAction")
    public ExportWordServletAction exportWordServletAction(ExportManager exportManager, ReportBuilder reportBuilder) {
        ExportWordServletAction exportWordServletAction = new ExportWordServletAction();
        exportWordServletAction.setExportManager(exportManager);
        exportWordServletAction.setReportBuilder(reportBuilder);
        return exportWordServletAction;
    }

    @Bean("ureport.exportPdfServletAction")
    public ExportPdfServletAction exportPdfServletAction(ExportManager exportManager, ReportBuilder reportBuilder, ReportRender reportRender) {
        ExportPdfServletAction exportPdfServletAction = new ExportPdfServletAction();
        exportPdfServletAction.setExportManager(exportManager);
        exportPdfServletAction.setReportBuilder(reportBuilder);
        exportPdfServletAction.setReportRender(reportRender);
        return exportPdfServletAction;
    }

    @Bean("ureport.exportExcelServletAction")
    public ExportExcelServletAction exportExcelServletAction(ExportManager exportManager, ReportBuilder reportBuilder) {
        ExportExcelServletAction exportExcelServletAction = new ExportExcelServletAction();
        exportExcelServletAction.setExportManager(exportManager);
        exportExcelServletAction.setReportBuilder(reportBuilder);
        return exportExcelServletAction;
    }

    @Bean("ureport.exportExcel97ServletAction")
    public ExportExcel97ServletAction exportExcel97ServletAction(ExportManager exportManager, ReportBuilder reportBuilder) {
        ExportExcel97ServletAction exportExcel97ServletAction = new ExportExcel97ServletAction();
        exportExcel97ServletAction.setExportManager(exportManager);
        exportExcel97ServletAction.setReportBuilder(reportBuilder);
        return exportExcel97ServletAction;
    }

    @Bean("ureport.imageServletAction")
    public ImageServletAction imageServletAction() {
        ImageServletAction imageServletAction = new ImageServletAction();
        return imageServletAction;
    }

    @Bean("ureport.importExcelServletAction")
    public ImportExcelServletAction importExcelServletAction() {
        ImportExcelServletAction importExcelServletAction = new ImportExcelServletAction();
        return importExcelServletAction;
    }

    @Bean("ureport.chartServletAction")
    public ChartServletAction chartServletAction() {
        ChartServletAction chartServletAction = new ChartServletAction();
        return chartServletAction;
    }

    @Bean("ureport.httpSessionReportCache")
    public HttpSessionReportCache httpSessionReportCache() {
        HttpSessionReportCache httpSessionReportCache = new HttpSessionReportCache();
        return httpSessionReportCache;
    }

    /**
     * fonts
     */
    @Bean("ureport.arialFontRegister")
    public ArialFontRegister arialFontRegister() {
        ArialFontRegister arialFontRegister = new ArialFontRegister();
        return arialFontRegister;
    }

    @Bean("ureport.comicSansMSFontRegister")
    public ComicSansMSFontRegister comicSansMSFontRegister() {
        ComicSansMSFontRegister comicSansMSFontRegister = new ComicSansMSFontRegister();
        return comicSansMSFontRegister;
    }

    @Bean("ureport.courierNewFontRegister")
    public CourierNewFontRegister courierNewFontRegister() {
        CourierNewFontRegister courierNewFontRegister = new CourierNewFontRegister();
        return courierNewFontRegister;
    }

    @Bean("ureport.fangSongFontRegister")
    public FangSongFontRegister fangSongFontRegister() {
        FangSongFontRegister fangSongFontRegister = new FangSongFontRegister();
        return fangSongFontRegister;
    }

    @Bean("ureport.heiTiFontRegister")
    public HeiTiFontRegister heiTiFontRegister() {
        HeiTiFontRegister heiTiFontRegister = new HeiTiFontRegister();
        return heiTiFontRegister;
    }

    @Bean("ureport.kaiTiFontRegister")
    public KaiTiFontRegister kaiTiFontRegister() {
        KaiTiFontRegister kaiTiFontRegister = new KaiTiFontRegister();
        return kaiTiFontRegister;
    }

    @Bean("ureport.songTiFontRegister")
    public SongTiFontRegister songTiFontRegister() {
        SongTiFontRegister songTiFontRegister = new SongTiFontRegister();
        return songTiFontRegister;
    }

    @Bean("ureport.timesNewRomanFontRegister")
    public TimesNewRomanFontRegister timesNewRomanFontRegister() {
        TimesNewRomanFontRegister timesNewRomanFontRegister = new TimesNewRomanFontRegister();
        return timesNewRomanFontRegister;
    }

    @Bean("ureport.yaheiFontRegister")
    public YaheiFontRegister yaheiFontRegister() {
        YaheiFontRegister yaheiFontRegister = new YaheiFontRegister();
        return yaheiFontRegister;
    }

}
